<#assign module="driver"/>

<@override name="header">
    <style>
        .table > thead > tr > th {
            text-align: center;
        }

        .table > tbody > tr > th {
            text-align: center;
        }

        .table > tbody > tr > td {
            vertical-align: middle;
            text-align: center;
        }
    </style>
</@override>
<@override name="body">
    <div class="tabbable tabs-left">
        <div class="row">
            <div class="col-xs-12 col-md-10">
                <div class="orders-navt">
                    <ul class="orders-nav">
                        <@shiro.hasPermission name='servicePersonal'>
                            <li style="width:90px;"><a href="${ctx}/driver/list">服务人员</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='drivergrade'>
                            <li style="width:110px;"><a href="${ctx}/drivergrade/list">服务人员等级</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='driverapply'>
                            <li><a href="${ctx}/driverapply/list" class="orders-click-a">申请</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='callLog'>
                            <li style="width:90px;"><a href="${ctx}/driver/recordlist">通话记录</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='notice'>
                            <li><a href="${ctx}/notice/list">通知</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='announcement'>
                            <li style="width:90px;"><a href="${ctx}/driver/announcementList">公告</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='drivermoney'>
                            <li style="width:90px;"><a href="${ctx}/driver/drivermoney">批量操作</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='drivermoney'>
                            <li style="width:110px;"><a href="${ctx}/driver/driverReward">服务人员奖励</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='driverenchashment'>
                            <li class="orders-click" style="width:100px;"><a href="${ctx}/driverenchashment/list">申请提现</a></li>
                            <li style="width:120px;"><a href="${ctx}/driverRebateenchashment/extendList">申请提取推广奖励</a></li>
                        </@shiro.hasPermission>
                        <@shiro.hasPermission name='driverloginrecord'>
                            <li style="width:90px;"><a href="${ctx}/driver/loginlist">登录日志</a></li>
                        </@shiro.hasPermission>
                    </ul>
                </div>
            </div>
            <div class="col-xs-1">
            </div>
        </div>
    </div>

    <div class="row margin-top" id="app">
        <form class="form-inline" role="form">
            <div class="col-xs-12">
                <div class="form-group">
                    <input type="text" class="form-control" style="width:300px;" id="param" name="param"
                           placeholder="输入姓名、工号、手机号、持卡人姓名">
                </div>
                <button id="searchButton" type="button" class="btn btn-primary"><i class="icon-search"></i>&nbsp;搜索
                </button>
                <button id="export_button" style="margin-left:10px;" type="button" class="btn btn-primary">
                    <i class="glyphicon glyphicon-save"></i>导出
                </button>
                <#--添加数据处-->
                <tag color="primary" type="dot">公司总收入：<span style="font-size: 14px; font-weight: normal;">{{income}}</span>&nbsp;元</tag>
                <tag color="success" type="dot">公司已提现总金额：<span style="font-size: 14px; font-weight: normal;">{{Math.round((withdraw + 64587.15) * 100) / 100}}</span>&nbsp;元</tag>
                <tag color="error" type="dot">公司总余额：<span style="font-size: 14px; font-weight: normal;">{{Math.round((balance - 64587.15) * 100) / 100}}</span>&nbsp;元</tag>
                <tag color="warning" type="dot">当天待审核提现总金额：<span style="font-size: 14px; font-weight: normal;">{{nonwithdraw}}</span>&nbsp;元</tag>
            </div>
        </form>
    </div>

    <div class="row margin-top">
        <div class="col-xs-12">
            <div class="tabta-content">
                <table class="table table-condensed table-striped ">
                    <tbody>
                    <tr>
                        <th>状态</th>
                        <th>姓名</th>
                        <th>工号</th>
                        <th>手机号</th>
                        <th>所属公司</th>
                        <th>申请金额</th>
                        <th>申请时间</th>
                        <th>开户行（网点）</th>
                        <th>卡号</th>
                        <th>收款人姓名</th>
                        <th>类型</th>
                        <th>操作</th>
                    </tr>
                    </tbody>
                </table>

                <ul class="pagination pull-left pagination-sm pageshow" id="pageshow" style="display:none;">
                    <li><a></a></li>
                </ul>
                <ul class="pagination pull-left pagination-sm pagedata" id="pagedata" style="display:none;">
                </ul>
            </div>

        </div>
    </div>

    <div class="modal fade" id="dialog_audit">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title">同意或驳回该申请</h4>
                </div>
                <div class="modal-body">
                    <input type="hidden" id="dialog_audit_id">
                    <div class="form-group">
                        <div class="col-xm-12">
                            <p class="form-control-static">
                                <label style="padding-right:20px;" id="dialog_audit_money">
                                </label><br/>
                                <label style="padding-right:20px;" id="dialog_audit_bank">
                                </label><br/>
                                <label style="padding-right:20px;" id="dialog_audit_cardNumber">
                                </label><br/>
                                <label style="padding-right:20px;" id="dialog_audit_masterName">
                                </label><br/>
                            </p>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" id="dialog_audit_success">同意</button>
                    <button type="button" class="btn btn-danger" id="dialog_audit_turndown">驳回</button>
                    <button type="button" class="btn btn-default" id="dialog_audit_close">关闭</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>

</@override>

<@override name="footer">
    <script type="text/javascript">
        window.daijia = {
            ctx: '${ctx}',
            userId: '<@shiro.principal property='id'/>'
        };
    </script>
    <script src="${ctx}/assets/js/jquery.paging.min.js"></script>
    <script src="${ctx}/assets/js/pushmessage.js"></script>
    <script src="${ctx}/assets/js/driver/driverenchashmentlist.js"></script>
    <script type="text/javascript">
        var thisButton;

        function deleteDriverApply() {
            $.post('${ctx}/driverapply/delete', {'id': thisButton.attr("data-value")}, function (data) {
                if (data.success) {
                    thisButton.parent().parent().remove();
                    $.scojs_message('服务人员申请删除成功', $.scojs_message.TYPE_OK);
                    setTimeout("window.location.reload(true)", 800);
                } else {
                    $.scojs_message(data.message, $.scojs_message.TYPE_ERROR);
                }
            }, 'json');
        }

        var onExporting = false;
        $("#export_button").click(function () {
            $('#dialog_export').modal();
            if (!onExporting) {
                onExporting = true;
                $.get(
                    ctx + '/driverenchashment/exportMoney',
                    {
                        'param': $("#param").val()
                    },
                    function (result) {
                        onExporting = false;
                        $("#export_process .progress-bar").css("width", "100%");
                        $("#export_process .progress-bar span").html("100%已完成");
                        window.location = ctx + "/" + result;
                    }
                );

                $("#export_process").show();
                $("#export_process .progress-bar").css("width", "1%");
                $("#export_process .progress-bar span").html("0%已完成");
                exportProcess();
            }
        });

        function exportProcess() {
            $.get(ctx + '/driverenchashment/exportMoneyProcess', {}, function (data) {
                if (null != data && data != "") {
                    $("#export_process .progress-bar").css("width", parseFloat(data) * 100 + "%");
                    $("#export_process .progress-bar span").html((parseFloat(data) * 100).toFixed(1) + "%已完成");
                }
            });
        }

        $(document).ajaxSuccess(function (event, xhr, settings) {
            if (settings.url.indexOf("exportOrderProcess") != -1) {
                setTimeout(function () {
                    exportProcess();
                }, 2000);//2s
            }
        });


    </script>
</@override>
<@extends name="../layout.ftl"/>